// import { methods } from "../uni_modules/uview-ui/libs/mixin/mixin.js";
import http from "./http.js";

//上传图片
export const uploadImg = http.BASE_URL + "api/index/upload";

//注册
export function register(data) {
	return http.request({
			url: "api/login/register",
			method: "post",
		},
		data,
		true
	);
}

//登录
export function login(data) {
	return http.request({
			url: "api/login/index",
			method: "post",
		},
		data,
		true
	);
}


//banner图
export function bannerList(data) {
	return http.request({
			url: "api/index/banner",
			method: "post",
		},
		data,
		true
	);
}


//分类列表
export function categoryList(data) {
	return http.request({
			url: "api/goods/category",
			method: "post",
		},
		data,
		true
	);
}



//商品列表
export function productslist(data) {
	return http.request({
			url: "api/goods/productslist",
			method: "post",
		},
		data,
		true
	);
}


//商品详情
export function productsdetail(data) {
	return http.request({
			url: "api/goods/productsdetail",
			method: "post",
		},
		data,
		true
	);
}


//地址列表
export function getuserareaList(data) {
	return http.request({
			url: "api/user/getuserarea",
			method: "post",
		},
		data,
		true
	);
}


//新增、编辑地址
export function adduserarea(data) {
	return http.request({
			url: "api/user/adduserarea",
			method: "post",
		},
		data,
		true
	);
}


//设置取消默认地址
export function setuserarea(data) {
	return http.request({
			url: "api/user/setuserarea",
			method: "post",
		},
		data,
		true
	);
}


//删除地址
export function deluserarea(data) {
	return http.request({
			url: "api/user/deluserarea",
			method: "post",
		},
		data,
		true
	);
}


//地址回显
export function getuserareaone(data) {
	return http.request({
			url: "api/user/get_userarea_one",
			method: "post",
		},
		data,
		true
	);
}


//平台公告
export function systemMessage(data) {
	return http.request({
			url: "api/index/system_message",
			method: "post",
		},
		data,
		true
	);
}


//公告详情
export function systemmessagedetails(data) {
	return http.request({
			url: "api/index/system_message_details",
			method: "post",
		},
		data,
		true
	);
}


//编辑个人资料
export function edituser(data) {
	return http.request({
			url: "api/user/edituser",
			method: "post",
		},
		data,
		true
	);
}


//当前用户信息
export function userinfo(data) {
	return http.request({
			url: "api/user/userinfo",
			method: "post",
		},
		data,
		true
	);
}



//加入购物车
export function addshopcar(data) {
	return http.request({
			url: "api/shopcard/addshopcar",
			method: "post",
		},
		data,
		true
	);
}



//购物车列表
export function shopcardlist(data) {
	return http.request({
			url: "api/shopcard/shopcardlist",
			method: "post",
		},
		data,
		true
	);
}


//修改购物车数量
export function editshopcarnum(data) {
	return http.request({
			url: "api/shopcard/editshopcarnum",
			method: "post",
		},
		data,
		true
	);
}

//删除购物车
export function delshopcar(data) {
	return http.request({
			url: "api/shopcard/delshopcar",
			method: "post",
		},
		data,
		true
	);
}


//获取默认地址
export function defaultAddress(data) {
	return http.request({
			url: "api/user/default_address",
			method: "post",
		},
		data,
		true
	);
}


//创建订单
export function createorder(data) {
	return http.request({
			url: "api/order/createorder",
			method: "post",
		},
		data,
		true
	);
}



//计算运费

export function countFreight(data) {
	return http.request({
			url: "api/order/count_freight",
			method: "post",
		},
		data,
		false
	);
}


//订单列表
export function userorders(data) {
	return http.request({
			url: "api/order/userorders",
			method: "post",
		},
		data,
		true
	);
}



//确认支付
export function waitpay(data) {
	return http.request({
			url: "api/order/waitpay",
			method: "post",
		},
		data,
		true
	);
}


//反馈中心
export function feedback(data) {
	return http.request({
			url: "api/user/feedback",
			method: "post",
		},
		data,
		true
	);
}



//修改密码
// export function editpassword(data) {
// 	return http.request({
// 			url: "api/user/editpassword",
// 			method: "post",
// 		},
// 		data,
// 		true
// 	);
// }

export function editpassword(data) {
	return http.request({
			url: "api/login/resetpassword",
			method: "post",
		},
		data,
		true
	);
}


//配置信息
export function getConfig(data) {
	return http.request({
			url: "api/index/get_config",
			method: "post",
		},
		data,
		true
	);
}


//联系我们
export function kefu(data) {
	return http.request({
			url: "api/index/kefu",
			method: "post",
		},
		data,
		true
	);
}


//自提点
export function selfpickuppoint(data) {
	return http.request({
			url: "api/index/self_pickup_point",
			method: "post",
		},
		data,
		true
	);
}


//订单详情
export function ordersdetail(data) {
	return http.request({
			url: "api/order/ordersdetail",
			method: "post",
		},
		data,
		true
	);
}


//确认收货
export function finishorder(data) {
	return http.request({
			url: "api/order/finishorder",
			method: "post",
		},
		data,
		true
	);
}


//评价
export function commentorder(data) {
	return http.request({
			url: "api/order/commentorder",
			method: "post",
		},
		data,
		true
	);
}


//取消订单
export function cancellation(data) {
	return http.request({
			url: "api/order/cancellation",
			method: "post",
		},
		data,
		true
	);
}


//申请售后
export function backsales(data) {
	return http.request({
			url: "api/order/backsales",
			method: "post",
		},
		data,
		true
	);
}


//退款订单详情
export function backordersdetail(data) {
	return http.request({
			url: "api/order/backordersdetail",
			method: "post",
		},
		data,
		true
	);
}


//撤销售后
export function delbacksales(data) {
	return http.request({
			url: "api/order/delbacksales",
			method: "post",
		},
		data,
		true
	);
}


//猜你喜欢
export function guessLike(data) {
	return http.request({
			url: "api/goods/guess_like",
			method: "post",
		},
		data,
		false
	);
}


//评价列表
export function productscomment(data) {
	return http.request({
			url: "api/goods/productscomment",
			method: "post",
		},
		data,
		true
	);
}


//详情页商品详情二维码
export function getCode(data) {
	return http.request({
			url: "api/user/getCode",
			method: "post",
		},
		data,
		true
	);
}


//分享二维码
export function invite(data) {
	return http.request({
			url: "api/user/invite",
			method: "post",
		},
		data,
		true
	);
}


//团队
export function team(data) {
	return http.request({
			url: "api/user/team",
			method: "post",
		},
		data,
		true
	);
}


//获取邀请码
export function sendsms(data) {
	return http.request({
			url: "api/login/sendsms",
			method: "post",
		},
		data,
		true
	);
}


//首页轮播公告
export function activity(data) {
	return http.request({
			url: "api/activity/index",
			method: "post",
		},
		data,
		true
	);
}


//获取地区列表
export function freight(data) {
	return http.request({
			url: "api/index/freight",
			method: "post",
		},
		data,
		true
	);
}



export function deliverySettings(data) {
	return http.request({
			url: "api/index/delivery_settings",
			method: "post",
		},
		data,
		true
	);
}

export function cardNum(data) {
	return http.request({
			url: "api/shopcard/card_num ",
			method: "post",
		},
		data,
		false
	);
}

export function orderCount(data) {
	return http.request({
			url: "api/order/order_count",
			method: "post",
		},
		data,
		true
	);
}





export function phoneisexist(data) {
	return http.request({
			url: "api/index/phone_is_exist",
			method: "post",
		},
		data,
		true
	);
}



//获取邮箱验证码
export function sendEamil(data) {
	return http.request({
			url: "api/login/send_eamil",
			method: "post",
		},
		data,
		true
	);
}